package com.wang.springframework.beans.factory.config;

import com.wang.springframework.beans.factory.HierarchicalBeanFactory;
import com.wang.springframework.util.StringValueResolver;

/**
 * @author wangjianhua
 * @Description
 * @date 2021/8/24/024 18:20
 **/
public interface ConfigurableBeanFactory extends HierarchicalBeanFactory,SingletonBeanRegistry {

    String SCOPE_SINGLETON = "singleton";

    String SCOPE_PROTOTYPE = "prototype";

    /**
     * 增加beanPostProcessor
     * @param beanPostProcessor beanPostProcessor
     */
    void addBeanPostProcessor(BeanPostProcessor beanPostProcessor);

    /**
     * 销毁单例对象
     */
    void destroySingletons();

    /**
     * 为嵌入值添加字符串解析器
     * @param valueResolver 应用于嵌入值的字符串解析程序
     */
    void addEmbeddedValueResolver(StringValueResolver valueResolver);

    /**
     * 解析给定的嵌入值，例如注释属性
     * @param value 要解析的值
     * @return 解析值 也可能是原始值
     */
    String resolvedEmbeddedValue(String value);
}
